import request from '../../utils/request'

// 添加公司
export function addCompany(data) {
    return request({
        url: '/wisdom-ab/company',
        method: 'post',
        data: data
    })
}

// 查询公司列表
export function listCompany(query) {
    return request({
        url: '/wisdom-ab/company/list',
        method: 'get',
        params: query
    })
}

// 查询公司列表
export function deleteCompany(companyId) {
    return request({
        url: '/wisdom-ab/company/' + companyId,
        method: 'delete'
    })
}

// 获取公司信息
export function getCompany(companyId) {
    return request({
        url: '/wisdom-ab/company/' + companyId,
        method: 'get'
    })
}

// 获取部门列表
export function listDept(query) {
    return request({
        url: '/wisdom-ab/department/list',
        method: 'get',
        params: query
    })
}
// 获取部门列表
export function listAllDept() {
    return request({
        url: '/wisdom-ab/department/listAll',
        method: 'get'
    })
}


// 保存部门
export function addDept(data) {
    return request({
        url: '/wisdom-ab/department',
        method: 'post',
        data: data
    })
}

// 获取部门
export function getDept(deptId) {
    return request({
        url: '/wisdom-ab/department/' + deptId,
        method: 'get'
    })
}

// 删除部门
export function delDept(deptId) {
    return request({
        url: '/wisdom-ab/department/' + deptId,
        method: 'delete'
    })
}

export const saveStaff = (data) => {
    return request({
        url: '/wisdom-ab/staff',
        method: 'post',
        data: data
    })
}

export const getStaff = (staffId) => {
    return request({
        url: '/wisdom-ab/staff/' + staffId,
        method: 'get'
    })
}

export const listStaff = (query) => {
    return request({
        url: '/wisdom-ab/staff/list',
        method: 'get',
        params: query
    })
}

